package com.example.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Controller
public class html {
    //返回数据
    @ResponseBody
    @RequestMapping("gethtml")
    public String testhtml(){
        return "/demo.html";
    }
   //返回demo.html这个html页面
    @RequestMapping("gethtml2")
    public String testhtml2(){
        return "/demo.html";
    }
    @ResponseBody
    @RequestMapping("sethtml")
    public String sethtml(){
        return "<h1>return html</h1>";
    }

}
